﻿from pycad.system import *
from pycad.runtime import *
from random import uniform

pts = [acge.Point3d(uniform(0, 100), uniform(0, 100), 0) for i in range(100000)]

@command()
@showtime
def pysort():
    from operator import itemgetter
    lst = sorted(pts, key = itemgetter(0, 1))

@command()
@showtime
def linqsort():
    import clr, System
    clr.ImportExtensions(System.Linq)
    from System.Collections.Generic import List
    q = pts.Cast[acge.Point3d]().OrderBy(lambda p: p.X).ThenBy(lambda p: p.Y)
    lst = List[acge.Point3d](q)
